<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/statics/css/sapar.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/statics/css/common.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/statics/css/detail.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/statics/css/bootstrap.min.css" />
<script type="text/javascript"
	src="${pageContext.request.contextPath }/statics/js/jquery.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/statics/js/sapar.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/statics/js/WdatePicker.js"></script>
<title>填写销售单</title>
</head>
<body>
	<div id="saper-container">
		<div id="saper-hd"></div>
		<div id="saper-bd">
			<div class="subfiled clearfix">
				<h2>填写销售单</h2>
			</div>
			<div class="subfiled-content">
				<div class="search-box clearfix">
					<div class="kv-item clearfix">
						<a href="#mymodal" data-toggle="modal" class="btn btn-primary">新增</a>
						<a href="${pageContext.request.contextPath }/getSaleListTOExcel.do" class="btn btn-primary">导出excel</a>
					</div>
					<div class="kv-item clearfix">
						<label>日期：</label>
						<div class="kv-item-content time-select-wrap">
							<div class="time-select">
								<input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
									placeholder="开始时间" /> <i class="date-icon"></i>
							</div>
							<span class="line">-</span>
							<div class="time-select">
								<input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
									placeholder="结束时间" /> <i class="date-icon"></i>
							</div>
						</div>
					</div>
					<div class="kv-item clearfix">
						<label>其他：</label>
						<div class="kv-item-content">
							<input type="text" placeholder="其他" />
						</div>
					</div>
					<a href="javascript:;" class="sapar-btn sapar-btn-recom query-btn">查询</a>
				</div>
				<!--表格开始-->
				<div class="table">
					<!--表格具体内容-->
					<div class="table-box">
						<table>
							<thead>
								<tr>
									<th width="20px" height="20px"><input type="checkbox"
										onchange="allCheck" /></th>
									<th>序号</th>
									<th class="num">销售单号</th>
									<th class="name">业务人员</th>
									<th class="node">客户名称</th>
									<th class="time">客户电话</th>
									<th class="time">商品品牌</th>
									<th class="process">填单日期</th>
									<th class="time">数量</th>
									<th class="time">进价</th>
									<th class="time">售价</th>
									<th class="time">销售日期</th>
									<th class="time">状态</th>
									<th class="operate">操作</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${saleList}" var="lists" varStatus="sta">
									<tr ${sta.index%2!=0?'style="background-color: #EFF6FA;"':''}>
										<td width="20px" height="20px"><input type="checkbox"
											name="idbox" id="idbox" value="${lists.sale_id}" /></td>
										<td>${sta.index+1}</td>
										<td>${lists.sale_id}</td>
										<td>${lists.sale_saler}</td>
										<td>${lists.customer_name}</td>
										<td>${lists.customer_telephone}</td>
										<td>${lists.product_brand}</td>
										<td><fmt:formatDate value="${lists.addsale_date}" /></td>
										<td>${lists.product_num}</td>
										<td>${lists.sale_intoprice}</td>
										<td>${lists.sale_outprice}</td>
										<td><fmt:formatDate value="${lists.sale_date}" /></td>
										<td><c:if test="${lists.sale_status eq 0}">启用</c:if> <c:if
												test="${lists.sale_status eq 1}">禁用</c:if></td>
										<td><a
											href="${pageContext.request.contextPath }/getSaleId.do?sale_id=${lists.sale_id}">修改</a>
											<a
											href="${pageContext.request.contextPath }/deleteSale.do?sale_id=${lists.sale_id}">删除</a></td>
									</tr>
								</c:forEach>
								<tr>
									<td colspan="13">
										<div align="right">
											<span>共${pages.totalCount }条记录${pages.currentPageNo}/${pages.totalPageCount }页</span>
											<c:if test="${pages.currentPageNo > 1}">
												<a href="javascript:page_nav(document.forms[0],1);">首页</a>
												<a
													href="javascript:page_nav(document.forms[0],${pages.currentPageNo-1});">上一页</a>
											</c:if>
											<c:if test="${pages.currentPageNo < pages.totalPageCount }">
												<a
													href="javascript:page_nav(document.forms[0],${pages.currentPageNo+1 });">下一页</a>
												<a
													href="javascript:page_nav(document.forms[0],${pages.totalPageCount });">最后一页</a>
											</c:if>
										</div>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<!--表格结束-->
			</div>
		</div>
		<div id="saper-ft"></div>
	</div>

	<!--弹出的模态框-->
	<div id="mymodal" class="modal fade">
		<!-- modal固定布局，上下左右都是0表示充满全屏，支持移动设备上使用触摸方式进行滚动。。-->
		<div class="modal-dialog modal-lg">
			<!-- modal-dialog默认相对定位，自适应宽度，大于768px时宽度600，居中-->
			<div class="modal-content">
				<form action="${pageContext.request.contextPath }/addSale.do" method="post" enctype="multipart/form-data">
					<!-- modal-content模态框的边框、边距、背景色、阴影效果。-->
					<div class="modal-header">
						<button class="close" data-dismiss="modal">&times;</button>
						<center>
							<h3 class="modal-title">填写销售单</h3>
						</center>
					</div>
					<div class="media-body">
						<div class="addjiejidan">
							<center>
								<table bordercolor="lightgray" border="2">
									<tr align="right">
										<td>客户名称</td>
										<td><input type="text" class="form-control"
											name="customer_name" /></td>
										<td>客户电话</td>
										<td><input type="text" class="form-control"
											name="customer_telephone" /></td>
										<td>状态</td>
										<td><select class="form-control" name="sale_status">
												<option value="-1">请选择</option>
												<option value="0">启用</option>
												<option value="1">禁用</option>
										</select></td>
									</tr>

									<tr align="right">
										<td>商品品牌</td>
										<td><input type="text" class="form-control"
											name="product_brand" /></td>
										<td>商品数量</td>
										<td><input type="text" class="form-control"
											name="product_num" /></td>
										<td>进价</td>
										<td><input type="text" class="form-control"
											name="sale_intoprice" /></td>
										<td>售价</td>
										<td><input type="text" class="form-control"
											name="sale_outprice" /></td>
									</tr>
									<tr>
										<td>下单时间</td>
										<td>
											<div class="time-select">
												<input type="text" class="form-control"
													onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
													placeholder="下单时间" name="addsale_date"/> <i class="date-icon"></i>
											</div>
										</td>
										<td>销售日期</td>
										<td>
											<div class="time-select">
												<input type="text" class="form-control"
													onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
													placeholder="销售时间" name="sale_date"/> <i class="date-icon"></i>
											</div>
										</td>
										<td>备注</td>
										<td><textarea class="form-control" name="sale_note">
											
										</textarea></td>
									</tr>
								</table>
							</center>
						</div>
					</div>
					<div class="modal-footer">
						<button class="btn btn-default" data-dismiss="modal">关闭</button>
						<input type="submit" value="新增" class="btn btn-primary" />
					</div>
				</form>
			</div>
		</div>

	</div>
</body>
<script type="text/javascript"
	src='${pageContext.request.contextPath }/statics/js/jquery-1.12.4.js'></script>
<script type="text/javascript"
	src='${pageContext.request.contextPath }/statics/js/bootstrap.js'></script>
<script type="text/javascript">
	$('select').iSelect();
</script>

</html>